@echo off
:loop
REM Change the ip to match the corresponding SoftLayer account to which we are connecting thru VPN i.e DevOps/AppOps
ping -n 4 10.61.99.107 | find "TTL"
if %ERRORLEVEL%==1 (
	echo "Need to reconnect"
	"C:\Program Files (x86)\Array Networks\VpnApp\VPNApp.exe" -connect sslvpn.networklayer.com 443 <SOFTLAYER_ID> <SOFTLAYER_PASSWD> 0
	REM  A wait for a minute to let VPN establish the connection before proceeding.
	timeout 300
	goto loop
)
REM  Wait 5 minutes before the next check
timeout 300
goto loop